package com.ruicar.afs.cloud.parameter.commom.enums;

import lombok.Getter;

/**
 * @description: 挂靠方式枚举
 * @author: sijun.yu
 * @date: 2020/5/13 19:36
 */
@Getter
public enum AffiliatedWay {

    NO("00", "无"),
    COMPANY_AFFILIATED("01", "第三方公司挂靠"),
    PERSONAL_AFFILIATED("02", "个体工商挂靠"),
    NETWORK_CAR_AFFILIATED("03", "网约车挂靠");

    private final String index;
    private final String name;

    private AffiliatedWay(String index, String name) {
        this.index = index;
        this.name = name;
    }

    public static String getName(String index) {
        for (AffiliatedWay affiliatedWay : AffiliatedWay.values()) {
            if (affiliatedWay.getIndex().equals(index)) {
                return affiliatedWay.getName();
            }
        }
        return null;
    }
}
